fix first major bug mentioned in previous commit