Fixed error where dbid is -1