fixed spl script logic