first working version of lua port monitor