added SQL stuff not sure if it works