removed err parameter from first argument to functions