added functionality to show comments at the right time