improve support of custom width