return errors to user; name anon functions