Fixed automcplete not properly replacing text