bugfix - gets caught in loop