Added code to check if tm is running