the wait call now works with milliseconds