added conditions for functionCode