what does this do in the case where ctx = ""? seems like it would add something that would create bad syntax.