moved error handling to partial