Fixing append function.