added option for userdefined target directory