chaiwat upate function login