added console logging for command function