Edited the function to get URLParameters in js, and fixed the messages display