fixed bugs in the watch command