trying to fix javascript