fixed bug with chain of > 2 starting with emtpy space