Throw exception when size is not integer