moved print statement to logging