Fixing double call to same function