change implementation of waiting