debugged the is_empty case