added support for receiving commands