JS Bug fix