bug fix after merge with Brian