Added handling for null boxes