Move check for existing task to rundb