Fixed js bug in page editor