Fixing bugs in template not sending users to the right location