Fixed bug with initialization check