implemented more foolproof way of getting user folder