made async
implemented file watching