fixed bad javascript