Modified the implementation file to work with my project.
There wer many memory crashes and finally resolved the issue.