fixed a bug with the exp function