introduce alot of bugs, add stdin listener