Moved ifChanged method call bo appropiate place