--- a/branches/2.5.4/cgi-bin/yabb2/Sources/ModifyMessage.pm
+++ b/branches/2.5.4/cgi-bin/yabb2/Sources/ModifyMessage.pm
@@ -14,7 +14,7 @@
 our $VERSION = '2.5.4';
 use CGI::Carp qw(fatalsToBrowser);
 
-$modifymessagepmver = 'YaBB 2.5.4 $Revision: 1014 $';
+$modifymessagepmver = 'YaBB 2.5.4 $Revision: 1069 $';
 if ( $action eq 'detailedversion' ) { return 1; }
 
 if ( !$post_txt_loaded ) {
@@ -831,7 +831,16 @@
       (
         int( ( $treplies - $postid ) / $maxmessagedisplay ) *
           $maxmessagedisplay );
-    $yySetLocation = qq~$scripturl?num=$threadid/$start#$postid~;
+    my $rts = $FORM{'return_to'};		
+    if ($rts == 3) {
+        $yySetLocation = qq~$scripturl~;
+    }
+    elsif ($rts == 2) {
+        $yySetLocation = qq~$scripturl?board=$currentboard~;
+    }
+    else { 
+        $yySetLocation = qq~$scripturl?num=$threadid/$start#$postid~;
+    }	
     redirectexit();
     return;
 }