Added error for record not found