auth logic added