added undefined check on rounds