fixed typeerror