fix joint mask creation

Signed-off-by: Zarrar Shehzad <czarrar@gmail.com>