Fix handler is not a string
Merge branch 'bencoder-fix-handler-object' into namespace-5.3

Add check to create handler only if it is not an object already