pass func by value