added limits so that it wont crash