Remove dead code
fix condition in packagemanager