Patch for detail action taking wrong parameter

Problem:
* When using the index and detail action from the same page we should use parameter(1)
* When using the index and detail action from different pages we should use parameter(0)

Solution:
* This patch will take the last parameter and use that for getting the data.