fixed issue when NOPERM flag was set