better error-handling in post