fixed file handling for accounts in database