Added a function to delete record