changed next to begin