initialize function fix