Changed code to resize chat window properly