fix take not working for functions