sigmoid memory overflow fixed