re-enabling button if an error occurs