Final fix: working finally(Manual merge from the submission branch)