added test for bug 540