added some checks and relays