can you just move this into the outer if statement?