merged fix from diamondback branch