Safari homepage hijacked and I can't change back imac 2011 10.10.5

Safari had homepage hijacked and I can't change it back to google.com.  When I go to Safari preferences and try and change, it just immediately goes to www.rack-search.com/....

I tried deleting all the com.apple.safari.plists in library.

Can you help?
This answer is not for a malware hijack situation, but rather a bug in Safari 11.0 that does not allow you to change the homepage. If you try to change the homepage, as soon as you defocus from that field, it reverts back to the original.

The workaround is:


Enter the new homepage. Do not press tab/enter or leave the field.
Click on another tab in Preferences, such as the Advanced tab.


Now it should ask you to confirm to change your homepage.