change the if block for the PWD rule