Fixed conflict error

Worked on the sql statement and did some testing