Spectrophotometric and voltammetric characterization of a novel selective electroactive chemosensor for Mg2+