fixed input with proper error handling

yeah