fixed infinit loop
xtendified code