should fix #779

this should fix #779, needs to be tested tho