-Handle recursive functions correctly