fixes #4472 Error in console when you try to add a new content

Fixed the issue and pushed code for review please check it.