Fix mistake in checking file extension in javascript.