removed unreachable code
tried to fix sqlite
new message handling