Add isdir and keep permission method