Added cancel button and code for new item.