lots of changes, find were the bug was !