queue tasks in the database