Before student deletion function