The influence of surface potential on the optical switching of spiropyran self assembled monolayers