Fixed missing import and var declaration