fixed index 500 error