fixed bug in function code mask