it would be nice to have logging here in the if and the else.