Fix setPassword crash bug