Add safequeue and scheduler