fixed relay bug