tried to fix javascript