Added write_pickle call on q