Fix unicode errors
Pass messages limit as a parameter