removed wait from loop