removed wait, added proper client handling