fix a bug when posting message, redirect does not work properly