Fixed missing variable error