Clearly, you have an hour(serial_number)
function somewhere, overriding your global hour variable. So please rename either the function or the variable.
As for the 'reset()' function, please tell us if it is called at all, or if it throws an error, and which one.