wrong order in fix for endless loops