fixes js bug