added setInterval and counter to wait until callback comes from async methods