Fixed max issues but not working 100%