fix layout path and write handler errors