fixing mask bug