Error fixed in get_selected_data