sp should be global