error handling on inputs