revert previous fix, use a slightly better approach