Used yield insteadof sleeping