Invalid type error fixed