fixxed nullpointer in inverse