use wait method, remove dummy loop