Fixed wrong substr