cleaned the sql part  thx Kinzcool