corrected bad javascript that was causing error