starting to fix javascript