fixed another bug in the implementation