Fixed errors due to depraciated code structure