fixed right boundary issue