moved libs out of global var