File extension not recognised correctly