Solved the error with dynamic dispatch

Have to do some testing later on.