script to monitor process