fixing rate mode error and reset first spike time