Added extra validation when CkEditor is not loaded in order to append to the correct input.
improved logic
fixed bugs