fix routine, add log