fixed null pointer exception during addition of task