fix some bug and add function
add lua plugin