fixed beginning loop