fixed to work with the latest xc16 compiler