Some more javascript logic added