fixed bug with checking return type of calling function instead of function to be called function