a much better solution to issue 809