React component working better now