I was writing this sentence:
If people were not there for their friends when they need them the most, the world wouldn't be a nice place to live.
I know that according to the rule of second conditional the first part should be in simple past and in the second we should use would. However, saying needed in my sentence would make it sound to me as if I was talking about a past event when in fact I am talking about a hypothetical situation.
What is the correct tense that I should use in this sentence?