conditionals on thread macro where wrong

TODO write a macro for this