made logging function responsive