added authorization functionality