fix for negative w and h