Implemented auth better