bugfix: improper calculation of mask tasks