Moved the initialization into else block as recommended