major bug fix