added sort feature for titles. Bug when disconnecting and reconnecting.