add register handler in lua