Fixed for loop in ajax call for mail data.
- TODO: fix setInterval call.