add log function to easily debug