added modals and fixed errors