chaiwat update function login