Made some modification to the code above.. try it now.