manually added changes from contributor @k0s