modified insert procedure