fix terminal output and adjust filtering