Added resign function