fix timing issue in background tabs