added function calling handling