Updated to use nio file