Add savePirate method and fix bug in signIn