fixed queue bug
init db needs def