fixed 'set' method to handle page reload