Change if statement to work correctly. Add AJAX and appending abilities. All works