fixied javascript errors