javascript errors fix