Added mask detection for detection