fix checking functions which has no return statement
resolve calling forward reference to function definition