fixed add call and edited endif to endfor