fixed timing issues, added ajax loading gif for slow connections.