Added empty() function to the closing of the modal so it won't show the remaining content from the last time the modal was open.