Corrected checkSelected