fixed horizontal/vertical bug