add and edit mostly working