Merge from forked repo
Following Rob's comment updated to use wait param