fixed download button logic