better error handling for invalid package names