fix init logic