Removing redundant controls. Fixing error handling for messages