reordered js calls
switched to data from server FINALLY