Capital flows and credit booms in emerging market economies