fixed global variable
added todo