Added selection size checking