Replace the method of how two byte[] are copied. Also closed the connections from Database.