Fix permalink creation for new record
Reformatted code