solves #174

Works nice for me, even though i'm not sure if i fixed it in the right place