fixed errors in isChecked method, should work but needs to be tested
added case for null in isChecked method