Looks like you have a lot of redundant code there. Factor it down to only that which is necessary.
Also, never put a ready hander inside another ready handler. And you have two different syntax's for ready handlers; that's bad form -- pick one syntax and stick with it. Otherwise it just confuses people reading your code.