added message querying