modify add and new function