Removed unneccesary check for infinite loop