move init check to after definitions