Javascript not called - moved up in file structure