add timeout and fix newline issues for stock