Fixed Uncaught InvalidStateError