added timeouts to prevent misplaced newlines