allow multiple instances (fixes #3); handle case when ajax request failed