fix message parsing
add priority support for handlers