added authentication and proper storing of data