fix args-out-of-range

Was causing an error on timer tick when the buffer was empty.