can now handle invalid authentication
removed bad cookie handling