added mask conditions