Fix bug in SD