Fixed function call inside fork