Fixed output resetting sometimes