Stream Handler Error: Invalid object was provided