Fixed and tested isSet function