Fix closing and reopen bug. Justin Canas