fix width calculation