move localStorage op to the end