Adding exception in show_list function