Restrict storing only 5 records in database