Add exception handling for invalid package name