EDIT: Solved the issue, unfortunately I am unable to share the code due to an NDA I agreed to with my client.