fixed small bug...still infinitely loops