Yep sure more than happy to modify it if that is better practice but just wanna mention that this code is working in my app, which is running in production.