Soap dispener not working

I’ve tried replacing the motor and the switch sensor but it’s still finishing with most of the soap in the cup. I’m having issues figuring this out, and don’t want to keep ordering parts that I’m going to have to send back.