Man arrested while leaving courthouse