fixed register variable bug