validate dimension