Code to limit number of items