Added masks support