finish function to delete