fixed bug in function declaration