call functions properly