if out dir is not created due to some error no permissions will be changed
added support for a base directory through configuration