Improved the Wait command