Added fog task management; Additional error checks