working version of layer and auth