implemented ajax and paperclip functionalities