Added auth, better error trapping