Added mysql check
Added switch_to function