trying to fix javascript errors