added a logging funcition