Fixing js destroy