added support for both cases