getting login working correctly