Code change as suggested in issue 898. Close #898