Added auth logic