this fixes #NGEO-1207 and #NGEO-1566