Added onClose function and button to close second view