Fixes error in next component logic