fixed to correctly call the serialize function