fixed some sp errors