Adjusted to newer version of Unity