null object reference error in action script : used resize handler to resize my component/. But it is throwing error:

    <?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
			   xmlns:s="library://ns.adobe.com/flex/spark" 
			   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
			   resize="application2_resizeHandler(event)" >
	<fx:Declarations>
		<!-- Place non-visual elements (e.g., services, value objects) here -->
	</fx:Declarations>
	
	<fx:Script>
		<![CDATA[
			import mx.events.FlexEvent;
			import mx.events.ResizeEvent;
			
			private var employeeName:String = 'ravi';
			
			protected function application2_resizeHandler(event:ResizeEvent):void
			{
				mainGroup.width = stage.width - 10;
				mainGroup.x = 5;
				
			}
			
		]]>
	</fx:Script>
	
	<s:Group width="100%" height="100%">
		<s:VGroup id="mainGroup" >
			<s:Label id="employeeNameLabel" text="{employeeName}" />
			<s:Label id="departmentLabel"  />
		</s:VGroup>
		
		<s:Button id="getData" />
	</s:Group>
</s:Application>

 