Add dir detection in paste callback. Prevent add item to changed page.