Forgot piece of code temporarly removed and re-implemented