Workaround for issue #305

I just tried to make it work, it might be wrong/dangerous/garbage.
PLEASE REVIEW.

Signed-off-by: Ｖ字龍(Vdragon) <pika1021@gmail.com>