fixed fairly major bug