implement issue #1323