JSLinted
fixed fence middle position check