log.debug needs to be before return statement