Fix a bug on checking installing packages