fixing mask layout issues