bug fix by william