fixing a bug in ipython notebook