Properly check for presence of stored password
Create folder before writing the password