Change sd global variable to main.cpp