Changes to determine user by directory instead of name.