improve safety and dirs serving