Why not move this before the previous if, to simplify things?