refactored message sending, fixed invalid css