Added an intermediary variable in nvp formula

This will prevent npv from changing the given array content.