made code read from relay to begin