Bug Fix

Didn't use global variable