Rebase sg

This is a hack for avoiding an obscure bug, I know it's not the best, but it worked so far, once I'll find the root of the problem I'll remove this from the existence.