change setTimeout to setInterval / added ajax timeout