Added check to see whether theres any tasks