fix #1009 but I wonder what this breaks....