changed the way a DB and table are opened from shell event