Attempting to fix error, needs testing