Make package manage more robust