Trying to fix javascript