added test coverage for #504