add error handling of render method