replaced call_user_func_array by our function