Identify and fix the bug in the following Python code.
def remove_duplicates(ls):
    result = []
    for e in ls:
        if e not in result:
            result.append(e)
    return result
def remove_duplicates(ls):
    result = []
    for e in ls:
        if e not in result:
            result.append(e)
    return list(set(result))