Reworked with new mysql module