Updated ensure authenticated