handle activerecord record not found exception