Fixed scratch insert bug