fix bug to set previously used engine/database