error handling for posting