added support for watch mode (-w flag)