-f was being used instead of -d for checking the User Resource Directory existence. Also, remove an indentation inconsistency in the script.