loop bug in sfj fixed