Added tests. Changes the way that the on set method sets the value