fixed another bug in optimze using kill