Fixed back/forward button hiding and showing properly. Added helper methods to clean up code