some modification for IPython