Changed wait to true/false