added debug if