Revised watchdir functionality