refactored add and save callbacks
fixed return statement in prepare function, fixed filename issue