bug mentioned in last commit resolved