add type checker for function declaration