added in external pw handling