When i click on the home button of the x axis the extruder moves towards the endstop but when it reach the end the motor doesn't stop but it keep on pulling and making a loud noise for a long period before stopping, it's quite the problem since i think it would break with time... I tried changing the endstop,the wire and setting the maximum instead the minimun but nothing changed, i fear it's a problem of the arduino

Another thinkg it's that when i press multiple times the homing the home for the X moves on the opposite direction by some millimeters for each click setting there the new home and never going back.
I'm having quite the hard time.