replaces source with . as per stack overflow suggestion