Honda 400ex starting issue Help

my Honda 400ex has been giving me some problems starting lately sometimes it will start fine other time there is just one click coming from the solenoid I have noticed when it does that if I tap the starter solenoid with a hammer I can get it to crank I also just cleaned up all the terminals and checked the battery voltage its 12.64 volts anyone have any idea I just changed the started solenoid not to long ago I bought one new off ebay for like 12 bucks I wouldn’t think that’s bad already thanks