login working and setting event