fixed race-condition on shown