wait statements added