added auth storing and checking