fixed issue where logic for checking if task was hidden was around the wrong way
refactored code involving wrong logic previously