JS code for resolving an issue