merge bug fix by Joseph