Add additional checks for when no messages exist or the wrong message is requested.