Added brake statement in the if clause after the start of MainActivity

Fixed the issue of the loop creating a massive amount of MainActivities
once the creation criteria was met.