Better error handling, define env module in subscribebutton