improve client.lua