adds exception handling to the inputs during testing