Removed redundant rejects/fixed alerting in js