already updated to check null, and reset() now it is consistent with Node