optimized the directive so the modal html doesn't need to be inserted to a specified place