fixed initialization timing issue