New function to check existance of attachment