fixing dimension change logic error