Added check of user and directory