fixed horizontal check

added the horizontal check.