Fixed bug in updating relay table query.