added checkbox logic