Added a fix for missing variable declaration