fixed dbwhere to not SIGSEGV