Refactor code to work concurrently
Quick fixed the bug