refactor upload queue using databases 2/2