added package upgrade method to refresh attribute db; fixed bug in code display