Added the functionality to restore the last color set in case the back button was pressed