add check if file or directory exists