Changes proper_wait to use wait and resume