Fix don't try to query db with '' as initial value