Added if statements to check if packages already defined