Stability-mediated epistasis constrains the evolution