Troubleshooting the WiFly shield for Arduino

hi, til now i was not able to connnect to available wify network with my wifly shield.

i tried to connect mannually from command mode

and it associated.

but i m not able to connect by my sketch

is there some problem with the library?