major bug fix attempt 4