return error to frontend if submit failed