The ```if``` check for ```$success``` is on purpose outside the ```is_writable``` ```if``` so we can handle the case when ```is_writable``` returns false. In that case ```$success``` remains unset and we throw an exception.