size checking added