Implemented function to delete at the end