moving log statements to default function