Try/catch clause to prevent bad input