I'd move this check down to line 29