Automation is not fired

Please format your code as recommended here: Format it Properly