the bug hunt continues my logic might be faulty
It is now back to a state of working still go some improvments to make.