fixed #854 for master