Added global attribute
Created a scope before compiling function code