Improvement to wait regular expression when installation or update happens