fix case clause when using db impl