Added a check for function redefinition