How to manage risk in stock investing