Bug with initialization in other function is fixed