Another attempt at fixing the bug