Fixed import issue and starting discovery of packages and instances after db is ready