Updated time a functionality on the modal to avoid scope issues. Still have a few bugs to work out.