introduced (hopefully) major fix when it comes to optimization