Added an exception for deleting from an empty list