added resetting to initkeys