factors to consider before investing in stocks