Fix bug in generating new task storage instance