Adding code to hide and destroy modal