Added sql server detect, fixed security issue