fixed some issues with dbh and im