Fix doubled up code