added switch modes for mysql