add some size checking