check for package being defined before source regex
Also check for package being defined before checking package for spaces and slashes