Loading of wrong frame due to slow reply from server

Hi,
I am working on an application having its front end in Flash.
I experience a rare problem as explained below. In some location, where the application is used, when authentication of a user happens, the frame of login failed appears even though the authentication is success. The asction script is getting values from XML file.
It gets the correct value but still, wrong farme loads. When I click on login failed, the next loading frame comes.
The correct working is that loading frame should load once authentication is success.

This problem appears only in few systems and cannot be replicated always.

Please let me know if you know how to resolve this.

Nans