added support for custom logout method