upgrade sendto and login function