bug fix and 2.5 compatibility