Added Error Handling for record not found