correctly detect function calls vs return