returns code to previous state