fixed add and edit issues, functioning pagination.