issue 2451 better code