Settings splited to user and directory and added permission check for dir.