error handling on gem