Rd7
a

You were definitely in a lot of trouble! Maybe Qf8? It helps defend g7, hits the rook, and gives the king an escape sqaure on e7
1. ...Qf8
2. Qh7+ Kf7
3. Bg6+ Ke7 and you seem to be hanging in there...
1. ...Qf8
2. Bc4+ Kh8
3. Bd3 Kg8 would be at least a forced draw by white.
Don't know if its sound or not.
[COMMENT DELETED]