minor bug fix by william