added min dimension checking