made sure the crete doesn't break when given bad input