fixed issue with negative deltas